feat(cli): add video discovery output#133
Open
abimaelmartell wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class CLI support for requesting page-level video discovery via --format video, with single-format output printing newline-separated video URLs while JSON/multi-format output retains full videos metadata (and keeps the legacy video field working).
Changes:
- Add
videoas a supported scrape/download/search scrape format and wire it through option parsing/help text. - Implement
videooutput behavior: raw newline-separated URLs for single-format, andvideosmetadata passthrough for JSON/multi-format. - Add/adjust TypeScript types and expand unit tests and README/versioning to cover the new format.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/output.ts | Adds video raw output handling and ensures videos metadata is included in multi-format JSON output when video is requested. |
| src/utils/options.ts | Allows video in --format parsing/validation. |
| src/types/scrape.ts | Adds video to ScrapeFormat, introduces VideoItem/ScrapeDocument, and narrows ScrapeResult.data typing. |
| src/index.ts | Updates CLI help strings to mention video; adds a guard/error for parse --format video. |
| src/commands/scrape.ts | Exposes video in the interactive wizard’s format picker. |
| src/tests/utils/output.test.ts | Adds tests for single-format video raw output and multi-format JSON inclusion of videos. |
| src/tests/utils/options.test.ts | Adds coverage for parsing video as a valid format. |
| src/tests/commands/search.test.ts | Extends scrape format type-safety test to include video. |
| src/tests/commands/scrape.test.ts | Extends scrape format type-safety test to include video. |
| README.md | Documents --format video usage and the --json metadata behavior; bumps displayed version. |
| package.json | Bumps package version to 1.19.7. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
502
to
505
| .option( | ||
| '-f, --format <formats>', | ||
| 'Output format(s), comma-separated (default: markdown). Available: markdown, html, rawHtml, links, images, summary, json' | ||
| 'Output format(s), comma-separated (default: markdown). Available: markdown, html, rawHtml, links, images, summary, json, video' | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for the
videoscrape format in the CLI so page-level video discovery can be requested directly. Single-formatvideooutput prints discovered video URLs, while JSON and multi-format output preserve the fullvideosmetadata array and the legacyvideofield remains supported.This also updates CLI help, docs, and tests around video format parsing and output behavior.